package zuoye5_28_1;

import java.util.*;
import java.sql.*;

public class MySqlStudentDao implements ChengjiDao {

	@Override
	public int add(Chengji s) {
		String sql = "insert into `examresult`(exam_date,score,st_id,sb_id)values(?,?,?,?)";
		return DBUtil.executeUpdate(sql, s.getExam_date(), s.getScore(),
				s.getSt_id(), s.getSb_id());
	}

	@Override
	public int del(Long id) {
		String sql = "delete from examresult where id=?";
		return DBUtil.executeUpdate(sql, id);
	}

	@Override
	public int update(Long id, Long score) {
		String sql = "update examresult set score=? where id=?";
		return DBUtil.executeUpdate(sql, score, id);
	}

}
